<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="" autocomplete="off">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8" style="text-align: center;font-size: 22px;">
            {$row.name|htmlentities}  班号录入
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('选择年级')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select  id="c-group" data-rule="required" class="form-control" name="group[group]" onchange="changetype(this)">
                {foreach name="groups" item="vo"}
                <option value="{$key}">{$vo.name}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('录入年级班号(⽤“逗号”隔开)')}:</label>
        {foreach name="groups" item="vo"}
        <div class="col-xs-12 col-sm-8" id="group-{$key}" {if $current != $key} style="display:none;" {/if}>
                <textarea id="c-numbers" class="form-control" name="group[numbers][{$key}]" rows="5" placeholder="示例：⼀班,⼆班">{$vo.numbers|htmlentities}</textarea>
    </div>
    {/foreach}
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
<script>
    function changetype(obj){
        var group = $(obj).val();
        $('#group-'+group).show().siblings('div').hide();
    }
</script>

